package com.bawei.yangzongcai___chenmei.BlankFragment.Blanck1;


import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.animation.BounceInterpolator;
import android.widget.ImageView;

import com.bawei.yangzongcai___chenmei.MVC.BsaeFragment;
import com.bawei.yangzongcai___chenmei.R;


public class BlankFragmentZhu1 extends BsaeFragment {


    private ImageView donghua;

    @Override
    public int bandLayout() {
        return R.layout.fragment_blank_fragment_zhu1;
    }

    @Override
    public void initView() {
        donghua = findbandid(R.id.donghua);
    }

    @Override
    public void initDate() {

        //透明
        ObjectAnimator alphaObjectAnimator = ObjectAnimator.ofFloat(donghua,"alpha",0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1f);
        alphaObjectAnimator.setInterpolator(new BounceInterpolator());
        alphaObjectAnimator.setDuration(10000);
        //       alphaObjectAnimator.start();

        //缩放
        ObjectAnimator scaleObjectAnimator = ObjectAnimator.ofFloat(donghua,"scaleY",2f,1f,2f,1f,2f,1f,2f,1f,2f,1f,2f,1f);
        scaleObjectAnimator.setDuration(10000);
        scaleObjectAnimator.setInterpolator(new BounceInterpolator());
        //       scaleObjectAnimator.start();

        //平移
        ObjectAnimator translationObjectAnimator =  ObjectAnimator.ofFloat(donghua,"translationY",-300f,300f,-300f,300f,-300f,300f,-300f,10f);
        translationObjectAnimator.setInterpolator(new BounceInterpolator());
        translationObjectAnimator.setDuration(10000);

        //风火轮旋转
        ObjectAnimator rotationObjectAnimator = ObjectAnimator.ofFloat(donghua,"rotation",-180f,180f,-360f,180f,-360f,120f,-180f,180f,-180f,360f,-180f,180f,-360f,180f,-360f,120f,-180f,180f,-180f,360f,-180f,180f,-360f,180f,-360f,120f,-180f,180f,-180f,360f);
        rotationObjectAnimator.setInterpolator(new BounceInterpolator());
        rotationObjectAnimator.setDuration(10000);
        //      rotationObjectAnimator.start();

        AnimatorSet animatorSet = new AnimatorSet();
        animatorSet.setDuration(50000);
        animatorSet.setInterpolator(new BounceInterpolator());
        animatorSet.play(alphaObjectAnimator).before(scaleObjectAnimator).after(rotationObjectAnimator).with(translationObjectAnimator);
        animatorSet.start();













    }
}
